﻿using ASP.NET_Routing_Table.BusinessLayer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ASP.NET_Routing_Table.Products
{
    public partial class ProductItem : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            DetailsView1.ChangeMode(DetailsViewMode.Insert);
        }

        protected void Save_Click(object sender, EventArgs e)
        {
            Product item = (Product)DetailsView1.DataItem;
            ProductsOperations.AddProduct(item);

            Response.Redirect("/Products/List");
        }
    }
}